package com.game.eggscatcher.GameObjects;

import com.badlogic.gdx.math.Intersector;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;

public class Ro {
	private Vector2 position, originPos;
//	private int velocityX;
	private Rectangle boundingRect;
	public final int WIDTH = 25;
	public final int HEIGHT = 15;
	
	private int score = 0;
	private int trungLives = 3;
	private int shitLives = 3;
	
	public Ro(float x, float y){
		
		position = new Vector2(x, y);
		originPos = position;
		boundingRect = new Rectangle();
	}
	
	public void update(float x) {
		position.x = x - WIDTH/2;
		boundingRect.set(position.x, position.y, WIDTH, HEIGHT);
	}
	public void moveLeft() {
		if ((position.x - WIDTH/2) > 0) position.x -= 5;
		else position.x = - WIDTH/2;
		boundingRect.set(position.x, position.y, WIDTH, HEIGHT);
	}
	public void moveRight() {
		if ((position.x + WIDTH/2) < 136) position.x += 5;
		else position.x = 136 - WIDTH/2;
		boundingRect.set(position.x, position.y, WIDTH, HEIGHT);
	}
	public float getX() {
		return position.x;
	}
	public float getY() {
		return position.y;
	}
	
	public void addScore(int increment) {
		score += increment;
	}
	
	public void decShitLives() {
		shitLives--;
	}
	
	public void decTrungLives() {
		trungLives--;
	}
	public int getScore() {
		return score;
	}
	public int getShitLives() {
		return shitLives;
	}
	public int getTrungLives() {
		return trungLives;
	}
	public Rectangle getBoundRect() {
		return boundingRect;
	}

	public void reset() {
		score = 0;
		shitLives = 3;
		trungLives = 3;
		position = originPos;
	}

	public void levelUp() {
		shitLives = 3;
		trungLives = 3;
		position = originPos;
		
	}
}
